package com.eso.haBank.domain

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

@EqualsAndHashCode
@ToString(includeNames = true, includeFields = false, excludes = 'metaClass,beforeInsert,beforeUpdate')
class Customization implements Serializable {

    String customizeName;//个性化类型名称
    String customizeValue;//内容
    String customizeType;//个性化类型
    String contentType;//内容类型

    String comment;//备注

    String createUser;
    Date createTime;
    String updateUser;
    Date updateTime;

    static constraints = {
        customizeName(maxSize: 100, blank: false)
        customizeValue(maxSize: 2000, blank: false)
        customizeType(inList: ['01', '02', '03', '04', '05', '06']);

        contentType(maxSize: 20, blank: false, inList: ['text', 'image', 'textArea'])

        comment(maxSize: 250, nullable: true)

        createUser(blank: false, maxSize: 20)
        createTime(nullable: true)
        updateUser(blank: false, maxSize: 20)
        updateTime(nullable: true)
    }


    def beforeInsert = {
        createTime = new Date()
        updateTime = new Date()
    }

    def beforeUpdate = {
        updateTime = new Date()
    }

    static mapping = {
        table 'sys_customization'
        version false
    }
}
